-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ResultSet& ValueWrapper sugars for Graph Visualisation & Data Sci #323
Conversation
result = session.execute('GET SUBGRAPH WITH PROP 2 STEPS FROM "player101" YIELD VERTICES AS nodes, EDGES AS relationships;') v = result.dict_for_vis() implement: #318
@@ -29,7 +42,7 @@ def result_to_df(result: ResultSet) -> pd.DataFrame: | |||
col_name = columns[col_num] | |||
col_list = result.column_values(col_name) | |||
d[col_name] = [x.cast() for x in col_list] | |||
return pd.DataFrame.from_dict(d, columns=columns) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there were errors here.
@@ -59,6 +60,28 @@ | |||
assert resp.is_succeeded(), resp.error_msg() | |||
print_resp(resp) | |||
|
|||
# query data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added coverage of those examples
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #323 +/- ##
==========================================
- Coverage 76.90% 75.61% -1.29%
==========================================
Files 18 18
Lines 2516 2625 +109
==========================================
+ Hits 1935 1985 +50
- Misses 581 640 +59 ☔ View full report in Codecov by Sentry. |
in a straightforward way
- Readme getting started polished - Config should be able to omit - The previous SessionPoolConfig Check mechnism was wrong, fixed it
@@ -192,6 +192,187 @@ def rows(self): | |||
return [] | |||
return self._data_set_wrapper.get_rows() | |||
|
|||
def dict_for_vis(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the result value is just a path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it hands Path use cases, too(even a list of paths ideally), it literally hands all results that are feasible to be rendered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Paths, it'll extract edge list and node list, too. For all graph Vis Lib, edge list and node list are all they needed.
maybe we can move |
I think we could for now put it here as the self-contained hint, or in a gist to refer it to, but YES, we could further create FE libs to work with it! What do you think? |
👍 |
how about we do this in a new repo, e.g. graph-sci ? and it could generate dafaframe from:
|
Yes we can! And that one would be super function complete and with proper dependencies with those sci toolchain. In this repo I kept the minimal feature workable with opinionated defaults(not tweak-able), yet with all dependencies import in function, thus our client won't depend on pandas etc... |
Maybe it's not suitable to post in this thread, but I think it's worth to share the emerging project. https://github.com/Pometry/Raphtory Which has some great ideas! |
Lovely embedded one!quite inspiring for the API! |
return {name: category}; | ||
}); | ||
|
||
option = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the G6's APIs are more suitable for Graph special visualization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense, I can provide mainstream libs flavor of output, including g6.
implement: #318, #324
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number: #318 , #324
Description:
resultSet.dict_for_vis()
easily get node list/ edge list and more information in ANY query as a result.
resultSet.as_pandas()
Get pandas dataframe with all data primitive typed